SA-MP Forums Archive
smail help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: smail help (/showthread.php?tid=552496)



smail help - astanalol - 24.12.2014

Hello Every One
i Want Know How To Make
You Have Killed From Admin Name
i Want Know How To Make The Name
with this simple script
PHP код:
CMD:adkill(playeridparams[])
{
    new 
targetid;
       if(
PlayerInfo[playerid][pRank] >= && PlayerInfo[playerid][pRank] <= 8)
    if(
sscanf(params"u"targetid)) return SendClientMessage(playeridCOLOR_RED"[USAGE]: /adkill [Part of Name/Player ID]");
    
SetPlayerHealth(playerid,0);
    return 
1;




Re : smail help - StreetRP - 24.12.2014

PHP код:
CMD:adkill(playeridparams[]) 

    new 
targetid,name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME]; 
    
GetPlayerName(playeridnamesizeof(name));    
   if(
PlayerInfo[playerid][pRank] >= && PlayerInfo[playerid][pRank] <= 8
    if(
sscanf(params"u"targetid)) return SendClientMessage(playeridCOLOR_RED"[USAGE]: /adkill [Part of Name/Player ID]"); 
    
SetPlayerHealth(playerid,0); 
    
format(stringsizeof(string),"Admin %s killed you.",name);
    
SendClientMessage(playerid, -1string);   return 1




Re: smail help - astanalol - 24.12.2014

there error
Quote:

D:\ffff\gamemodes\textdraws.pwn(2049) : error 017: undefined symbol "Format"
D:\ffff\gamemodes\textdraws.pwn(2049) : error 017: undefined symbol "commandes"
D:\ffff\gamemodes\textdraws.pwn(2049) : error 029: invalid expression, assumed zero
D:\ffff\gamemodes\textdraws.pwn(2049) : fatal error 107: too many error messages on one line

line 2049
PHP код:
Format(commandessizeof(commandes),"Admin %s killed you.",name); 



Re : Re: smail help - StreetRP - 24.12.2014

Quote:
Originally Posted by astanalol
Посмотреть сообщение
there error

line 2049
PHP код:
Format(commandessizeof(commandes),"Admin %s killed you.",name); 
I have edit my post


Re: smail help - astanalol - 24.12.2014

its error


Re : Re: smail help - StreetRP - 24.12.2014

Quote:
Originally Posted by astanalol
Посмотреть сообщение
its error
Whats is the error , copy my first poste he should work's


Re: Re : smail help - mamorunl - 24.12.2014

Quote:
Originally Posted by StreetRP
Посмотреть сообщение
PHP код:
CMD:adkill(playeridparams[]) 

    new 
targetid,name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME]; 
    
GetPlayerName(playeridnamesizeof(name));    
   if(
PlayerInfo[playerid][pRank] >= && PlayerInfo[playerid][pRank] <= 8
    if(
sscanf(params"u"targetid)) return SendClientMessage(playeridCOLOR_RED"[USAGE]: /adkill [Part of Name/Player ID]"); 
    
SetPlayerHealth(playerid,0); 
    
format(stringsizeof(string),"Admin %s killed you.",name);
    
SendClientMessage(playerid, -1string);   return 1

This script will kill you. Fix those damn if-statements with normal brackets, this is ridiculous.


Re : Re: Re : smail help - StreetRP - 24.12.2014

PHP код:
CMD:adkill(playerid,params[]) // This will never change
{
    new 
pID,name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
    if(
isnull(params)) return SendClientMessage(playeridCOLOR_RED"[USAGE]: /adkill [Part ofName/PlayerID]");
    
GetPlayerName(playeridnamesizeof(name));
    
SetPlayerHealth(pID,0);
    
format(stringsizeof(string),"Admin %s killed you.",name);
    
SendClientMessage(pID, -1string);
    return 
1;




Re: Re : Re: Re : smail help - Kimossab - 24.12.2014

Quote:
Originally Posted by StreetRP
Посмотреть сообщение
PHP код:
CMD:adkill(playerid,params[]) // This will never change
{
    new 
pID,name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
    if(
isnull(params)) return SendClientMessage(playeridCOLOR_RED"[USAGE]: /adkill [Part ofName/PlayerID]");
    
GetPlayerName(playeridnamesizeof(name));
    
SetPlayerHealth(pID,0);
    
format(stringsizeof(string),"Admin %s killed you.",name);
    
SendClientMessage(pID, -1string);
    return 
1;

that will never work, you never gave a value to pID, you need to use sscanf (facepalm)

pawn Код:
CMD:adkill(playerid,params[])
{
       if(PlayerInfo[playerid][pRank] < 2 || PlayerInfo[playerid][pRank] > 8) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You can't use this cmd.");
    new pID;
    if(sscanf(params,"u",pID)) return SendClientMessage(playerid, COLOR_RED, "[USAGE]: /adkill [Part ofName/PlayerID]");
    if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: That player is not connected.");
    new name[MAX_PLAYER_NAME], string[20+MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    SetPlayerHealth(pID,0);
    format(string, sizeof(string),"Admin %s killed you.",name);
    SendClientMessage(pID, -1, string);
    return 1;
}