/vslap help please !
#1

Someone have a /vslap script ? ( vehicle slap ) , i have this script but when i compile it ..
Код:
 C:\Users\Alexunder\Desktop\godfatherNEW.pwn(36761) : warning 202: number of arguments does not match definition
C:\Users\Alexunder\Desktop\godfatherNEW.pwn(36761) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
i got this.

My script =>>>
Код:
//----------------------[VSlap]---------------
if(strcmp(cmd, "/vslap", true) == 0) {
        if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pAdmin] >= 1) {
            new id = strval(tmp);
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) {
                SendClientMessage(playerid,COLOR_GREEN ,"[HELP]: /vslap [carid]");
                return 1;
            }
            id = GetPlayerVehicleID(playerid);
            new Float:x, Float:y, Float:z;
            GetVehiclePos(id, x, y, z);
            SetVehiclePos(id, x, y, z+5);
            format(string, sizeof(string),"[ADMIN] %s has slapped car id %s",GetPlayerName(playerid), id);

            return 1;
            }
        }
Reply
#2

There is no problem? there's only warnings? they are harmless
Reply
#3

Quote:
Originally Posted by basse
Посмотреть сообщение
There is no problem? there's only warnings? they are harmless
Ok . this is the line with problem
Код:
format(string, sizeof(string),"[ADMIN] %s has slapped car id %s",GetPlayerName(playerid), id);
What is the problem ? Why don't leave me to compile it.. ? !
Reply
#4

You have to get their name inside of the function, you can't use it inside of a format.

pawn Код:
new playerName [ MAX_PLAYER_NAME ];

GetPlayerName( playerid, playerName, sizeof( playerName ) );

format( string, sizeof ( string ), "[ADMIN] %s has slapped car id %s",playerName, id);
Reply
#5

Quote:
Originally Posted by basse
Посмотреть сообщение
There is no problem? there's only warnings? they are harmless
You can only ignore 2 warnings
Код:
warning 217: loose indentation
warning 203: symbol is never used: ****
You can ignore the rest of it, but your command/function will not work.
Reply
#6

Thanks i just solved the problem.
Here de script for others person.
Код:
if(strcmp(cmd, "/vslap", true) == 0) {
        if(PlayerInfo[playerid][pAdmin] >= 1) {
            new id = strval(tmp);
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) {
                SendClientMessage(playerid,COLOR_GREEN ,"[HELP]: /vslap [carid]");
                return 1;
            }
            id = GetPlayerVehicleID(playerid);
            new Float:x, Float:y, Float:z;
            GetVehiclePos(id, x, y, z);
            SetVehiclePos(id, x, y, z+5);
            format(string, sizeof(string),"[ADMIN] %s has slapped car id %s",GetPlayerVehicleID(playerid), id);

            return 1;
            }
        }
Reply
#7

Quote:
Originally Posted by Rapk1d
Посмотреть сообщение
Thanks i just solved the problem.
Here de script for others person.
Код:
if(strcmp(cmd, "/vslap", true) == 0) {
        if(PlayerInfo[playerid][pAdmin] >= 1) {
            new id = strval(tmp);
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) {
                SendClientMessage(playerid,COLOR_GREEN ,"[HELP]: /vslap [carid]");
                return 1;
            }
            id = GetPlayerVehicleID(playerid);
            new Float:x, Float:y, Float:z;
            GetVehiclePos(id, x, y, z);
            SetVehiclePos(id, x, y, z+5);
            format(string, sizeof(string),"[ADMIN] %s has slapped car id %s",GetPlayerVehicleID(playerid), id);

            return 1;
            }
        }
No....

pawn Код:
if(strcmp(cmd, "/vslap", true) == 0) {
        if(PlayerInfo[playerid][pAdmin] >= 1) {
            new id = strval(tmp), plName [ 24 ];
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) {
                SendClientMessage(playerid,COLOR_GREEN ,"[HELP]: /vslap [carid]");
                return 1;
            }
            GetPlayerName( playerid, plName, 24 );
            new Float:x, Float:y, Float:z;
            GetVehiclePos(id, x, y, z);
            SetVehiclePos(id, x, y, z+5);
            format(string, sizeof(string),"[ADMIN] %s has slapped car id %s",plName, id);

            return 1;
            }
        }
would solve your problem.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)