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

Wysłany: 2012-12-30, 10:22


Rumun







Wiek: 30
Na forum: 5235 dni
Posty: 316
Nick w MP: Rumun

Piwa: 25

Respekt: 69

Witam.Mam taki problem ,nawet dwa problemy,bo z dwoma komendami.Jedna to:

/ann

Kod:

CMD:ann(playerid, params[])
{
if(!IsPlayerAdmin(playerid))
return SendClientMessage(playerid, 0xFF0000FF, "Nie masz uprawnie");

new time, tmp[128], msg[100];
if(sscanf(params, "is[100]", time, msg))
return SendClientMessage(playerid, 0xFFFFFFFF, "/ann [czas] [text]");

format(tmp, sizeof(tmp), "~w~%s", msg);
GameTextForAll(tmp, time*1000, 3);
return 1;
}



druga to:

/givecash

Kod:

CMD:givecash(playerid, params[])
{
if(!IsPlayerAdmin(playerid))
return SendClientMessage(playerid, 0xFF0000FF, "Nie masz uprawnie?!");

if(!strcmp(params, "all"))
{
new kasa;
if(sscanf(params, "{s[5]}i", kasa))
return SendClientMessage(playerid, 0xFFFFFFFF, "/givecash [id/all] [kasa]");
for(new id; id!=GetMaxPlayers(); id++)
if(IsPlayerConnected(id)) GiveMoney(id, kasa);
return SendClientMessageToAll(0xFF0000FF, "Admin da? kase wszystkim graczom");
}

new id, kasa;
if(sscanf(params, "ri", id, kasa))
return SendClientMessage(playerid, 0xFFFFFFFF, "/givecash [id/all] [kasa]");

GiveMoney(id, kasa);
SendClientMessage(id, 0xFF0000FF, "Dosta?e? kase od Admina");
SendClientMessage(playerid, 0xFF0000FF, "Da?e? kase graczowi");
return 1;
}



Przy /ann mam nast?puj?ce b??dy:

Kod:

error 017: undefined symbol "msg"
error 017: undefined symbol "tmp"
error 017: undefined symbol "tmp"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line


Przy /givecash takie:

Kod:

error 017: undefined symbol "GiveMoney"
error 017: undefined symbol "GiveMoney"



Prosz? o pomoc.I jak zawsze piwko. ;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-30, 12:22


B!4CK

Never give UP!






Wiek: 32
Na forum: 5809 dni
Posty: 1047
Nick w MP: John

Piwa: 1891

Respekt: 124,2
Respekt: 124,2

new msg;
new tnp;

GiveMoney zamie? na givemoney, a jak dalej to samo to dodaj new givemoney;

Trzeba zdefinowa? ;p

Podpis
Cześć
! :)


Projekt, który poruszy scenę platformy SA:MP!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-30, 21:26


Rumun







Wiek: 30
Na forum: 5235 dni
Posty: 316
Nick w MP: Rumun

Piwa: 25

Respekt: 69

Okej.Mam jeszcze problem z komenda na dawanie score.

Kod:

CMD:givescore(playerid, params[])
{
new scoreplayer, scoreplayerscore, scoreplus, string[98];

if(!IsPlayerAdmin(playerid))

if(sscanf(params, "ud", scoreplayer, scoreplus))
return SendClientMessage(playerid, RED, "* Wpisz: /givescore [ID gracza] [punkty]");

format(string, sizeof(string), "* Da?e? %d punkt?w score graczowi %s",scoreplus, PlayerName(scoreplayer));
SendClientMessage(playerid, -1, string);
scoreplayerscore = GetPlayerScore(scoreplayer);
scoreplayerscore = SetPlayerScore(scoreplayer, scoreplayerscore+scoreplus);
return 1;
}



Komenda ta nie daj pkt score + jad wpiszemy /givescore 1 1 to score dostaje id 0 i score tez 0.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-30, 21:31


SobiPTR







Wiek: 31
Na forum: 5078 dni
Posty: 29

Piwa: 2

Respekt: 50

Cytat:

(playerid, -1, string);


na

Cytat:

(playerid, 0, string);


spr?buj


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-30, 23:14


Wafelowski







Wiek: 29
Na forum: 5347 dni
Posty: 428

Piwa: 100

Respekt: 232
Respekt: 232Respekt: 232

@UP: Wiesz w og?le do czego to s?u?y? To mu nie pomo?e.

Trzymaj:

Kod:


CMD:score(playerid, params[])
{
new pid, scorenow, scoreadd, string[98];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Nie masz uprawnie? do u?ycia tej komendy!");
if(sscanf(params, "ud", pid, scoreadd)) return SendClientMessage(playerid, -1, "U?yj: /givescore [ID] [Ilo??]");
if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, -1, "Ten gracz nie jest pod??czony!");

scorenow = GetPlayerScore(pid);
SetPlayerScore(pid, scorenow+scoreadd);

format(string, sizeof(string), "Gracz %s dosta? %d score od %s", PlayerName(pid), scoreadd, PlayerName(playerid));
SendClientMessage(playerid, -1, string);
return 1;
}


Specjalnie napisane dla ciebie, wszystko dzia?a :) .

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-31, 08:55


Rumun







Wiek: 30
Na forum: 5235 dni
Posty: 316
Nick w MP: Rumun

Piwa: 25

Respekt: 69

Teraz jest tak,?e jak admin wpisze /score id ilosc to pisze

gracz1 dosta? 0 score od gracza2. Nie wa?ne ile sie wpisze score zawsze dostaje si? 0.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-31, 09:13


okoospokoo







Wiek: 29
Na forum: 5089 dni
Posty: 102
Nick w MP: Shake/LeStunters

Piwa: 273

Respekt: 50

Sscanf aktualny i include? Je?li nie zaktualizuj i przekompiluj z nowym include : d P?jdzie na pewno xd

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-31, 10:07


Rumun







Wiek: 30
Na forum: 5235 dni
Posty: 316
Nick w MP: Rumun

Piwa: 25

Respekt: 69

Tak mam najnowszy sscanf.Nie chc? robi? nowego tematu wiec tutaj dodam rzecz z kt?r? mam problem.

Kod:

if(!strcmp(cmd, "/specplayer", true) && IsPlayerAdmin(playerid) == 1){
{
new tmp[256];
tmp = strtok(cmdtext, idx);

if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /specplayer [playerid]");
return 1;
}
specplayerid = strval(tmp);
if(!IsPlayerConnected(specplayerid)) {
SendClientMessage(playerid, COLOR_RED, "specplayer: that player isn't active.");
return 1;
}
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, specplayerid);
SetPlayerInterior(playerid,GetPlayerInterior(specplayerid));
return 1;
}


Czy ta komend zadzia?a + m?g?by kto? mi zmieni? na zcmd.

Ostatnio zmieniony przez Rumun 2012-12-31, 19:29, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-31, 10:41


ToxiC.







Wiek: 28
Na forum: 5246 dni
Posty: 3792

Piwa: 8590

Respekt: 1143,8
Respekt: 1143,8

Kod:



CMD:specplayer(playerid, params[])
{
if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Nie jeste? Adminem!");

if(isnull(params)) return SendClientMessage(playerid, -1, "U?yj /SpecPlayer [ID]");

new id = strval(params);

if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Nie ma takiego gracza");

TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, id);
SetPlayerInterior(playerid,GetPlayerInterior(id));
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-31, 11:26


Wafelowski







Wiek: 29
Na forum: 5347 dni
Posty: 428

Piwa: 100

Respekt: 232
Respekt: 232Respekt: 232

Bardziej rozbudowana komenda:

Kod:


CMD:spec(playerid, params[])
{
new pid, str[64];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Nie masz uprawnie? do u?ycia tej komendy!");
if(isnull(params) && GetPVarInt(playerid, "Spectating") == 0) return SendClientMessage(playerid, -1, "U?yj: /spec [ID Gracza]");

pid = strval(params);

if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, -1, "Ten gracz nie jest pod??czony!");
if(pid == playerid) return SendClientMessage(playerid, -1, "Nie mo?esz sam siebie podgl?da?!");

if(GetPVarInt(playerid, "Spectating") == 0)
{
TogglePlayerSpectating(playerid, 1);
if(!IsPlayerInAnyVehicle(pid))
{
PlayerSpectatePlayer(playerid, pid);
SetPlayerInterior(playerid,GetPlayerInterior(pid));
}
else
{
PlayerSpectateVehicle(playerid, GetPlayerVehicleID(pid));
}

SetPVarInt(playerid, "Spectating", 1);

format(str, sizeof(str), "SPEC: Aktualnie podgl?dasz gracza %s (ID:%d)", PlayerName(pid), pid);
SendClientMessage(playerid, -1, str);
SendClientMessage(playerid, -1, "SPEC: Aby anulowa? podgl?danie gracza wpisz ponownie /spec");
}
else if(GetPVarInt(playerid, "Spectating") == 1)
{
TogglePlayerSpectating(playerid, 0);
SetPlayerInterior(playerid, 0);
SetPVarInt(playerid, "Spectating", 0);
}
return 1;
}


Po za tym, komenda na punkty zosta?a zrobiona poprawnie to Ty co? sknoci?e?, testowa?em te komendy na dw?ch komputerach i dzia?aj? bez zarzut?w.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-31, 19:30


Rumun







Wiek: 30
Na forum: 5235 dni
Posty: 316
Nick w MP: Rumun

Piwa: 25

Respekt: 69

Ok dzi?ki.Mo?e wr??my do tej komendy /givecash nadal nie dzia?a a zrobi?em tak jak blackelegy kaza?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-01-01, 11:28


ToxiC.







Wiek: 28
Na forum: 5246 dni
Posty: 3792

Piwa: 8590

Respekt: 1143,8
Respekt: 1143,8

Kod:


CMD:givecash(playerid, params[])
{
if(!IsPlayerAdmin(playerid))
return SendClientMessage(playerid, 0xFF0000FF, "Nie masz uprawnie?!");

if(!strcmp(params, "all"))
{
new kasa;
if(sscanf(params, "{s[5]}i", kasa))
return SendClientMessage(playerid, 0xFFFFFFFF, "/givecash [id/all] [kasa]");
for(new id; id!=GetMaxPlayers(); id++)
if(IsPlayerConnected(id)) GivePlayerMoney(id, kasa);
return SendClientMessageToAll(0xFF0000FF, "Admin da? kase wszystkim graczom");
}

new id, kasa;
if(sscanf(params, "ri", id, kasa))
return SendClientMessage(playerid, 0xFFFFFFFF, "/givecash [id/all] [kasa]");

GivePlayerMoney(id, kasa);
SendClientMessage(id, 0xFF0000FF, "Dosta?e? kase od Admina");
SendClientMessage(playerid, 0xFF0000FF, "Da?e? kase graczowi");
return 1;
}


Postaw piwo autorowi tego posta
 

 
Tagi: komenda :: /ann :: /givecash
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