[Help]All Can use this cmd
#1

Hello Every One
Why all can use this CMD ? its player reguler and can use admin command why ?
PHP код:
CMD:goto(playeridparams[])
{
     
     new 
ID;
     new 
pn[MAX_PLAYER_NAME];
     new 
an[MAX_PLAYER_NAME];
     new 
str[128];
     if(
PlayerInfo[playerid][pRank] >= && PlayerInfo[playerid][pRank] <= 8//If you use rcon admin delete (PlayerInfo[playerid][pAdmin] >=1 ||
     
if(sscanf(params"u"ID)) return SendClientMessage(playerid0xFF0000AA"USAGE: /goto [ID]"); //This is a long line, "sscanf" is the plugin that search the missing params, "params" is the param that define params LOL, "u" is the PARAM that define the MISSING ID, ID is the param for the targetid
     
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid0xFF0000AA"ERROR: This player is not connected");//Same as !IsPlayerAdmin, but instead of "playerid" we put "ID" because it's the targetid
     
GetPlayerName(playeridanMAX_PLAYER_NAME);//Define the playerid's param
     
GetPlayerName(IDpnMAX_PLAYER_NAME);//Define the ID's param
     
new Float:x//Defining float X
     
new Float:y//Same
     
new Float:z//Same
     
GetPlayerPos(IDxyz); //This line get the "ID" position
     
SetPlayerPos(playeridx+1y+1z); //This line set the "playerid" position from "ID" position, with some changes(x+1, y+1);
     
format(strsizeof(str), "You have been teleported to %s"pn); //Showed before, this is the line that give the message to playerid)
     
SendClientMessage(playerid0x00FF00AAstr); //This line give the message to playerid
     
if(IsPlayerInAnyVehicle(playerid)) //Mhh, let's give you a question, what should this callback do?
     
{
          
GetPlayerPos(IDxyz);
          
SetVehiclePos(playeridx+1y+1z); //And this one? :D
     
}
     return 
1;

PHP код:
CMD:sethp(playeridparams[])
{
new 
targetid//as explained above
new amount//to store the amount of the health
if(PlayerInfo[playerid][pRank] >= && PlayerInfo[playerid][pRank] <= 8)
if(
sscanf(params"ui"targetidamount)) return SendClientMessage(playeridCOLOR_WHITE"Usage: /sethp [id] (amount)"); //as explained above
if(!IsPlayerConnected(targetid)) return SendClientMessage(playeridCOLOR_RED"This player is not connected"); //as explained above
SetPlayerHealth(targetidamount); //set the targetid health with the amount of the admin typed
SendClientMessage(targetidCOLOR_GREEN"An admin changed your health"); //Send a message to the target id that there is an admin changed his health
return 1;
}
CMD:setarmour(playeridparams[])
{
new 
targetid//As explained at the very above :D
if(PlayerInfo[playerid][pRank] >= && PlayerInfo[playerid][pRank] <= 8)
if(
sscanf(params"u"targetid)) return SendClientMessage(playeridCOLOR_WHITE"Usage: /setarmour [id]");//As explained above
if(!IsPlayerConnected(targetid)) return SendClientMessage(playeridCOLOR_RED"This player is not connected");//As explained above
SetPlayerArmour(targetid100.0); //Give him a full armour level
SendClientMessage(targetidCOLOR_GREEN"An admin added an armour to you");
return 
1;

This i Cant use it The Admin cant and Normal player not admin can use it wtf
PHP код:
CMD:vrespawn(playeridparams[])
{
    if(
PlayerInfo[playerid][pRank] >= && PlayerInfo[playerid][pRank] <= 8) return SendClientMessageplayerid, -1"Usage: Fucker This Only For Admins");
    new
        
bool:vehicleused[MAX_VEHICLES];
    for (new 
i=0MAX_PLAYERSi++) {
        if(
IsPlayerConnected(i) && IsPlayerInAnyVehicle(i)) {
            
vehicleused[GetPlayerVehicleID(i)] = true;
        }
    }
    for (new 
i=1MAX_VEHICLESi++) {
        if(!
vehicleused[i]) {
            
SetVehicleToRespawn(i);
            new 
name24 ], string64 ];
            
GetPlayerNameplayeridname24 );
            
formatstringsizeof(string), "Admin %s (has Respawn All Vehicles)"name );
            
GameTextForAllstring5000);
        }
    }
    return 
1;

please help me in this 2 problems +rep
please example what u add cuz i want know i have much commands buged
Reply
#2

change the symbols and may be will work
pawn Код:
if(PlayerInfo[playerid][pRank] <= 1 && PlayerInfo[playerid][pRank] >= 8)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)