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

Wysłany: 2014-07-19, 14:21


KaNdY







Wiek: 29
Na forum: 4487 dni
Posty: 53
Nick w MP: KaNdY

Piwa: 1

Respekt: 56,5

Witam! Chodzi oto, ?e po wpisaniu odpowiedniej komendy przez HEAD-ADMINISTRATORA nadaje Admina lub ViP'a, natomiast ja chc? przerobi?, by jaki? tak gracz o nicku '?mieszek' m?g? te komendy wpisywa?. Dodatkowo chcia?bym zablokowa? wpisywania ID, tylko nick z uwzgl?dnieniem ma?ych i du?ych liter + cyfr.

Oto przyk?adowa komenda:
Kod:


CMD:daj_vip(playerid, params[]) //Daj VIP'a
{
new leader;
new strcatx[256];
new name[31];
leader = strval(params);
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "{009933}»American Truck SA-MP«{FFFFFF} Nie jeste? Administratorem.");
if(isnull(params)) return SendClientMessage(playerid, -1, "{009933}»American Truck SA-MP«{FFFFFF} Komenda na danie ViP'a - /dvip [ID]");
if(!IsPlayerConnected(leader)) return SendClientMessage(playerid, -1, "{009933}»American Truck SA-MP«{FFFFFF} Niema gracza o podanym ID.");
ViP[leader] = 1;
GetPlayerName(leader, name, 31);
format(strcatx, 256, "{009933}»American Truck SA-MP«{FFFFFF} Da?e? graczowi %s range ViP.",name);
SendClientMessage(playerid, -1, strcatx);
SendClientMessage(leader, -1, "{009933}==================================");
SendClientMessage(leader, -1, "{009933}»American Truck SA-MP«{FFFFFF} Zosta?e? dodany do ViP'a.");
SendClientMessage(leader, -1, "{009933}==================================");
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-07-19, 14:31


IgrexolonO







Wiek: 34
Na forum: 6809 dni
Posty: 1386

Piwa: 1062

Respekt: 651,8
Respekt: 651,8Respekt: 651,8

Kod:

CMD:daj_vip(playerid, p[]) //Daj VIP'a
{
if(!IsPlayerAdmin(playerid) && strcmp(PlayerName(playerid), "?mieszek") != 0) return SendClientMessage(playerid, -1, "{009933}American Truck SA-MP{FFFFFF} Nie jeste? Administratorem.");
if(isnull(p)) return SendClientMessage(playerid, -1, "{009933}American Truck SA-MP{FFFFFF} Komenda na danie ViP'a - /dvip [ID]");
new player;
sscanf(p, "u", player);
if(player == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "{009933}American Truck SA-MP{FFFFFF} Nie ma gracza o podanych danych.");
ViP[player] = 1;
new strcatx[64];
format(strcatx, sizeof(strcatx), "{009933}American Truck SA-MP{FFFFFF} Da?e? graczowi %s range ViP.", PlayerName(player));
SendClientMessage(playerid, -1, strcatx);
SendClientMessage(leader, -1, "{009933}==================================");
SendClientMessage(leader, -1, "{009933}American Truck SA-MP{FFFFFF} Zosta?e? dodany do ViP'a.");
SendClientMessage(leader, -1, "{009933}==================================");
return true;
}


Ostatnio zmieniony przez IgrexolonO 2014-07-19, 18:21, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-07-19, 15:28


KaNdY







Wiek: 29
Na forum: 4487 dni
Posty: 53
Nick w MP: KaNdY

Piwa: 1

Respekt: 56,5

Kod:


C:\Users\Szymon\Desktop\Server\gamemodes\drift1.pwn(961) : error 017: undefined symbol "PlayerName"
C:\Users\Szymon\Desktop\Server\gamemodes\drift1.pwn(962) : error 017: undefined symbol "params"
C:\Users\Szymon\Desktop\Server\gamemodes\drift1.pwn(962) : error 029: invalid expression, assumed zero
C:\Users\Szymon\Desktop\Server\gamemodes\drift1.pwn(962) : error 017: undefined symbol "params"
C:\Users\Szymon\Desktop\Server\gamemodes\drift1.pwn(962) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.


Obie linijki:
Kod:


if(!IsPlayerAdmin(playerid) && strcmp(PlayerName(playerid), "TheKarmazyn") != 0) return SendClientMessage(playerid, -1, "{009933}American Truck SA-MP{FFFFFF} T? komende mo?e u?y? tylko{009933} TheKarmazyn{FFFFFF}.");
if(isnull(params)) return SendClientMessage(playerid, -1, "{009933}American Truck{FFFFFF} Komenda na danie ViP'a - /dvip [nick]");


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-07-19, 18:22


IgrexolonO







Wiek: 34
Na forum: 6809 dni
Posty: 1386

Piwa: 1062

Respekt: 651,8
Respekt: 651,8Respekt: 651,8

Kod:

stock PlayerName(playerid)
{
new n[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, n, sizeof(n));
return n;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-07-19, 18:42


Avast99







Wiek: 28
Na forum: 4648 dni
Posty: 135
Nick w MP: Avast99

Piwa: 352

Respekt: 126
Respekt: 126

A params zamie? na p

Postaw piwo autorowi tego posta
 

 
Tagi: komenda
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN » [INNE] Komenda 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