Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2012-11-07, 16:27


sirgutbert







Wiek: 32
Na forum: 5492 dni
Posty: 62
Nick w MP: kored

Piwa: 20

Respekt: 64

Ostrzeżeń: 20%
Czesc mam problem z kajdankami a mianowicie
jesli wpisz /kajdanki id to zakowa zawsze id 0
i jest mi jeszcze potrzebny timer z teleportacja
do policjanta ktory zakul tego gracza daje respekt i piwo

Kod:






if(strcmp("/kajdanki", cmdtext, true, 9)== 0)
if(gTeam[playerid] == TEAM_POLICJA)
{
new playerid2;

if(!strlen(cmdtext[9])) return SendClientMessage(playerid, -1, "Wpisz /kajdanki [id gracza]");
if(!IsPlayerConnected(strval(cmdtext[10]))) return SendClientMessage(playerid, -1, "Ten gracz nie jest online");
new Float:Pos[3],String[48];
GetPlayerPos(playerid2, Pos[0],Pos[1],Pos[2]);
if(!IsPlayerInRangeOfPoint(playerid, 10.0, Pos[0], Pos[1], Pos[2]))
return SendClientMessage(playerid, COLOR_WHITE, "Gracz nie znajduje si? obok Ciebie.");
if(Skuty[playerid2]==0)
{
PlayerPlaySound(playerid, 1190, 0.0, 0.0, 0.0);
Skuty[playerid2]=1;
SkutyPrzez[playerid2]=playerid;
SetPlayerSpecialAction(playerid2, SPECIAL_ACTION_CUFFED);
SetPlayerAttachedObject(playerid2, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
format(String, sizeof(String),"* %s skuwa kajdankami %s.",Nick(playerid),Nick(playerid2));
return 1;
}
if(Skuty[playerid2]==1)
{
for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
{
format(String, sizeof(String),"* %s odkuwa kajdankami %s.",Nick(playerid),Nick(playerid2));
PlayerPlaySound(playerid, 1190, 0.0, 0.0, 0.0);
Skuty[playerid2]=0;
SkutyPrzez[playerid2]=9999;
if(IsPlayerAttachedObjectSlotUsed(playerid2, i)) RemovePlayerAttachedObject(playerid, i);
SetPlayerSpecialAction(playerid2, SPECIAL_ACTION_NONE);
return 1;
}
}
return 1;
}


Podpis
Ostatnio zmieniony przez sirgutbert 2012-11-08, 14:40, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-11-07, 17:23


Combacior







Wiek: 29
Na forum: 5795 dni
Posty: 1516

Piwa: 2161

Respekt: 1060
Respekt: 1060

Ostrzeżeń: 20%
Kod:

if(strcmp("/kajdanki", cmdtext, true, 9)== 0)
if(gTeam[playerid] == TEAM_POLICJA)
{
new playerid2;

if(!strlen(cmdtext[9])) return SendClientMessage(playerid, -1, "Wpisz /kajdanki [id gracza]");
if(!IsPlayerConnected(strval(cmdtext[10]))) return SendClientMessage(playerid, -1, "Ten gracz nie jest online");

playerid2 = strval(cmdtext);

new Float:Pos[3],String[48];
GetPlayerPos(playerid2, Pos[0],Pos[1],Pos[2]);
if(!IsPlayerInRangeOfPoint(playerid, 10.0, Pos[0], Pos[1], Pos[2]))
return SendClientMessage(playerid, COLOR_WHITE, "Gracz nie znajduje si? obok Ciebie.");
if(Skuty[playerid2]==0)
{
PlayerPlaySound(playerid, 1190, 0.0, 0.0, 0.0);
Skuty[playerid2]=1;
SkutyPrzez[playerid2]=playerid;
SetPlayerSpecialAction(playerid2, SPECIAL_ACTION_CUFFED);
SetPlayerAttachedObject(playerid2, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
format(String, sizeof(String),"* %s skuwa kajdankami %s.",Nick(playerid),Nick(playerid2));
return 1;
}
if(Skuty[playerid2]==1)
{
for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
{
format(String, sizeof(String),"* %s odkuwa kajdankami %s.",Nick(playerid),Nick(playerid2));
PlayerPlaySound(playerid, 1190, 0.0, 0.0, 0.0);
Skuty[playerid2]=0;
SkutyPrzez[playerid2]=9999;
if(IsPlayerAttachedObjectSlotUsed(playerid2, i)) RemovePlayerAttachedObject(playerid, i);
SetPlayerSpecialAction(playerid2, SPECIAL_ACTION_NONE);
return 1;
}
}
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-11-07, 18:26


sirgutbert







Wiek: 32
Na forum: 5492 dni
Posty: 62
Nick w MP: kored

Piwa: 20

Respekt: 64

Ostrzeżeń: 20%
nadal to samo :x

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-11-07, 20:28


ToxiC.







Wiek: 28
Na forum: 5246 dni
Posty: 3792

Piwa: 8590

Respekt: 1143,8
Respekt: 1143,8

Mo?e masz co? z pluginem/includem sscanf. ? Zaaktualizuj go ;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-11-07, 20:32


sirgutbert







Wiek: 32
Na forum: 5492 dni
Posty: 62
Nick w MP: kored

Piwa: 20

Respekt: 64

Ostrzeżeń: 20%
Nie wszystko powinno byc dobrze ale dziala tylko dla id 0 inne
komendy dzialaja jak nalezy

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-11-07, 20:41


ToxiC.







Wiek: 28
Na forum: 5246 dni
Posty: 3792

Piwa: 8590

Respekt: 1143,8
Respekt: 1143,8

a tamt? komende kt?r? wczoraj Ci przerobi?em, to co z ni?? I czemu zak?adasz 3 tematy z podobnym problemem ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-11-07, 20:43


sirgutbert







Wiek: 32
Na forum: 5492 dni
Posty: 62
Nick w MP: kored

Piwa: 20

Respekt: 64

Ostrzeżeń: 20%
Temta komenda nie dzialala

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-11-07, 20:45


ToxiC.







Wiek: 28
Na forum: 5246 dni
Posty: 3792

Piwa: 8590

Respekt: 1143,8
Respekt: 1143,8

Mo?e ja?niej, powiedz co nie dzia?a, postaram si? pom?c.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-11-08, 14:38


sirgutbert







Wiek: 32
Na forum: 5492 dni
Posty: 62
Nick w MP: kored

Piwa: 20

Respekt: 64

Ostrzeżeń: 20%
Errory wywala?o

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-11-08, 18:42


ToxiC.







Wiek: 28
Na forum: 5246 dni
Posty: 3792

Piwa: 8590

Respekt: 1143,8
Respekt: 1143,8

Rany.. no to mo?e je poka?esz..?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-11-08, 19:26


Seboo







Wiek: 30
Na forum: 5515 dni
Posty: 124
Nick w MP: Sebo

Piwa: 1228

Respekt: 102
Respekt: 102

Kod:


if(strcmp("/kajdanki", cmdtext, true, 9) == 0)
{
if(gTeam[playerid] == TEAM_POLICJA)
{
new playerid2;

if(!strlen(cmdtext[9])) return SendClientMessage(playerid, -1, "Wpisz /kajdanki [id gracza]");
if(!IsPlayerConnected(strval(cmdtext[10]))) return SendClientMessage(playerid, -1, "Ten gracz nie jest online");
playerid2 = strval(cmdtext);
if(GetDistanceBetweenPlayers(playerid, playerid2) <10)
{
if(Skuty[playerid] == 0)
{
PlayerPlaySound(playerid, 1190, 0.0, 0.0, 0.0);
Skuty[playerid2] = 1;
SkutyPrzez[playerid2] = playerid;
TogglePlayerContrllable(playerid2, 0);
format(String, sizeof(String),"* %s skuwa kajdankami %s.",Nick(playerid),Nick(playerid2));
}
else
{
format(String, sizeof(String),"* %s odkuwa kajdankami %s.",Nick(playerid),Nick(playerid2));
PlayerPlaySound(playerid, 1190, 0.0, 0.0, 0.0);
Skuty[playerid2] = 0;
SkutyPrzez[playerid2] = 0;
TogglePlayerContrllable(playerid2, 1);
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Gracz nie znajduje si? obok Ciebie.");
}
}
else
{
SendClientMessage(playerid, -1, "Ta komenda jest dla policji.");
}
return 1;
}


Komenda.

Kod:

stock GetDistanceBetweenPlayers(playerid, twoplayerid)
{
new Float:dis, Float: x1, Float: y1, Float: z1, Float: x2, Float: y2, Float: z2;
GetPlayerPos(playerid, x1, y1, z1);
GetPlayerPos(twoplayerid, x2, y2, z2);
dis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
return floatround(dis);
}


T? funkcje wklej gdzie? na dole mapy.

Nie wiem czy dzia?a, polecam Ci u?ywa? ZCMD oraz sscanf2, lepiej i szybciej. Ja tak pisz? swoje skrypty i zawsze dzia?a, nie wiem czy to dzia?a, sprawd?. Je?li chcesz ?eby dodawa?o ten obiekt, to napisz, co? pokombinuj?. Zrobi?em, ?e gracza skutego zamra?a i po odkuciu odmra?a.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-11-08, 19:50


sirgutbert







Wiek: 32
Na forum: 5492 dni
Posty: 62
Nick w MP: kored

Piwa: 20

Respekt: 64

Ostrzeżeń: 20%
Kod:


C:\Users\delta6583\Desktop\ptr3.01c.pwn(3188) : error 017: undefined symbol "TogglePlayerContrllable"
C:\Users\delta6583\Desktop\ptr3.01c.pwn(3195) : error 017: undefined symbol "TogglePlayerContrllable"
C:\Users\delta6583\Desktop\ptr3.01c.pwn(11331) : error 025: function heading differs from prototype
C:\Users\delta6583\Desktop\ptr3.01c.pwn(11332) : error 021: symbol already defined: "GetDistanceBetweenPlayers"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.


Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-11-08, 19:56


Seboo







Wiek: 30
Na forum: 5515 dni
Posty: 124
Nick w MP: Sebo

Piwa: 1228

Respekt: 102
Respekt: 102

"error 021: symbol already defined: "GetDistanceBetweenPlayers" - Czyli posiadasz ju? t? funkcje. To t? funkcje usu? co Ci poda?em.

": error 017: undefined symbol "TogglePlayerContrllable" " - Moja liter?wka, powinno by? TogglePlayerControllable

Postaw piwo autorowi tego posta
 

 
Tagi: kajdanki
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku