22.02.2013, 17:44
Can someone tell me how I can change my strcmp commands to ZCMD I really need help and cant find a tutorial
//=================[Commands]===============================================
CMD:boost(playerid, params[])
{
if(GetPlayerMoney(playerid) <10000)
{
SendClientMessage(playerid,0xAA3333AA, "You are a little low on the dough.");
}
else
{
GivePlayerMoney(playerid,-10000);
AddVehicleComponent(GetPlayerVehicleID(playerid),1010);
}
return 1;
}
CMD:handsup(playerid,params[])
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
return 1;
}
CMD:start(playerid,params[])
{
SetPlayerPos(playerid,2313.4158,-1987.8317,13.5590);
return 1;
}
CMD:minigun(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "This command can only be used by an admin!!");
GivePlayerWeapon(playerid, 38, 500); //Give playerid minigun with 500 ammo
return 1;
}
CMD:heal(playerid,params[])
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "This command can only be used by an admin!!");
SetPlayerHealth(playerid, 100);
return 1;
}
CMD:engine(playerid,params[])
{
new vehicleid = GetPlayerVehicleID(playerid);//defining vehicleid is = to GetPlayerVehicleID.
new engine, lights, alarm, doors, bonnet, boot, objective;//these are the defines of the thing used in the command.
if(IsPlayerInAnyVehicle(playerid))//This will check that if a player is in the vehicle or not.
{
if(GetPlayerVehicleSeat(playerid) == 0) //Now this will check that if a player is on the driving seat or not.
{
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);//will check that what is the state of the engine.
if(engine == 1)//will check that if the engine in on or not.
{
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);//this will check that what is the state of engine.That is is on or off.We can use it for multiple things like doors,alarms etc.But In this case I am using this for the engine only.
SetVehicleParamsEx(vehicleid,false,lights,alarm,doors,bonnet,boot,objective);//when we change the engine and replace it with false,this will turn the vehicle engine off.Same if we make if true,this will make the engine on.
GameTextForPlayer(playerid,"Vehicle Engine Stopped!",2000,6);//for a text to appar on the screen for only 2 seconds.
return 1;
}
else
SetVehicleParamsEx(vehicleid,true,lights,alarm,doors,bonnet,boot,objective);//if vehicle engine is false it will change it to true.
GameTextForPlayer(playerid,"Vehicle Engine Started!",2000,6);//for a text to appar on the screen for only 2 seconds.
}
else SendClientMessage(playerid,-1,"Error: You are not at the driving seat!");//this is an error message,that if a player is not on the driving seat,this error message would appear.
return 1;
}
else
SendClientMessage(playerid,-1,"Error: You are not in a vehicle!");//this is the error message,that if a player is not in the car,the error message would apper.
}
CMD:camera(playerid,params[])
new Float:x, Float:y, Float:z;
GetPlayerCameraPos(playerid, x, y, z);
printf("You are looking at at %f,%f,%f.", x, y, z);
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/enter", true))
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1929.3467,-1776.0195,13.5469))
{
SetPlayerPos(playerid,-30.946699,-89.609596,1003.549988);//Idlegas entrance
SetPlayerInterior(playerid, 18);
}
}
if(!strcmp(cmdtext, "/exit", true))
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, -30.9595,-91.7379,1003.5469))
{
SetPlayerPos(playerid,1929.3467,-1776.0195,13.5469);//Idlegas Exit
}
}
if(strcmp(cmdtext, "/music", true) == 0)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "You are not in a vehicle!!");
ShowPlayerDialog(playerid, 4576, DIALOG_STYLE_LIST, "Music","Pulse FM Pure Dance\n Hip Hop", "Select", "Cancel");
}
if (strcmp("/v lights", cmdtext, true, 10) == 0)//Head light.
{
new vehicleid = GetPlayerVehicleID(playerid);//Gets the vehicle Id of the player
new engine, lights, alarm, doors, bonnet, boot, objective;//these are the defines of the thing used in the command.
if(IsPlayerInAnyVehicle(playerid))//This will check that if a player is in the vehicle or not.
{
if(GetPlayerVehicleSeat(playerid) == 0) //Now this will check that if a player is on the driving seat or not.
{
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);//will check that what is the state of the lights.
if(lights == 1)//will check that if the lights are on or not.
{
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);//this will check that what is the state of the lights.That is is on or off.We can use it for multiple things like doors,alarms etc.But In this case I am using this for the lights only.
SetVehicleParamsEx(vehicleid,engine,false,alarm,doors,bonnet,boot,objective);//when we change the engine and replace it with false,this will turn the vehicle engine off.Same if we make if true,this will make the engine on.
GameTextForPlayer(playerid,"The vehicle lights have been turned off.",2000,6);//for a text to appar on the screen for only 2 seconds.
return 1;
}
else
SetVehicleParamsEx(vehicleid,engine,true,alarm,doors,bonnet,boot,objective);//if vehicle engine is false it will change it to true.
GameTextForPlayer(playerid,"The vehicle lights have turned on!",2000,6);//for a text to appar on the screen for only 2 seconds.
}
else SendClientMessage(playerid,-1,"Error: You are not at the driving seat!");//this is an error message,that if a player is not on the driving seat,this error message would appear.
return 1;
}
else SendClientMessage(playerid,-1,"Error: You are not in a vehicle!");//this is the error message,that if a player is not in the car,the error message would apper.
}
if (strcmp("/frontfall", cmdtext, true, 10) == 0)
{
ApplyAnimation(playerid, "PED", "KO_shot_front",4.1,0,1,1,1,1);
return 1;
}
if (strcmp("/stopanim", cmdtext, true, 10) == 0)
{
ClearAnimations(playerid);
return 1;
}
return 0;
}
CMD:enter(playerid, params[]) { if(IsPlayerInRangeOfPoint(playerid, 3.0, 1929.3467,-1776.0195,13.5469)) { SetPlayerPos(playerid,-30.946699,-89.609596,1003.549988);//Idlegas entrance SetPlayerInterior(playerid, 18); } } CMD:exit(playerid, params[]) { if(IsPlayerInRangeOfPoint(playerid, 3.0, -30.9595,-91.7379,1003.5469)) { SetPlayerPos(playerid,1929.3467,-1776.0195,13.5469);//Idlegas Exit } } CMD:music(playerid, params[]) { if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "You are not in a vehicle!!"); ShowPlayerDialog(playerid, 4576, DIALOG_STYLE_LIST, "Music","Pulse FM Pure Dance\n Hip Hop", "Select", "Cancel"); } CMD:vlights(playerid, params[])//Head light. { new vehicleid = GetPlayerVehicleID(playerid);//Gets the vehicle Id of the player new engine, lights, alarm, doors, bonnet, boot, objective;//these are the defines of the thing used in the command. if(IsPlayerInAnyVehicle(playerid))//This will check that if a player is in the vehicle or not. { if(GetPlayerVehicleSeat(playerid) == 0) //Now this will check that if a player is on the driving seat or not. { GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);//will check that what is the state of the lights. if(lights == 1)//will check that if the lights are on or not. { GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);//this will check that what is the state of the lights.That is is on or off.We can use it for multiple things like doors,alarms etc.But In this case I am using this for the lights only. SetVehicleParamsEx(vehicleid,engine,false,alarm,doors,bonnet,boot,objective);//when we change the engine and replace it with false,this will turn the vehicle engine off.Same if we make if true,this will make the engine on. GameTextForPlayer(playerid,"The vehicle lights have been turned off.",2000,6);//for a text to appar on the screen for only 2 seconds. return 1; } else SetVehicleParamsEx(vehicleid,engine,true,alarm,doors,bonnet,boot,objective);//if vehicle engine is false it will change it to true. GameTextForPlayer(playerid,"The vehicle lights have turned on!",2000,6);//for a text to appar on the screen for only 2 seconds. } else SendClientMessage(playerid,-1,"Error: You are not at the driving seat!");//this is an error message,that if a player is not on the driving seat,this error message would appear. return 1; } else SendClientMessage(playerid,-1,"Error: You are not in a vehicle!");//this is the error message,that if a player is not in the car,the error message would apper. } CMD:frontfall(playerid, params[]) { ApplyAnimation(playerid, "PED", "KO_shot_front",4.1,0,1,1,1,1); return 1; } CMD:stopanim(playerid, params[]) { ClearAnimations(playerid); return 1; }
C:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(190) : warning 209: function "cmd_heal" should return a value
C:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(190) : error 010: invalid function or declaration
C:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(190) : error 021: symbol already defined: "SetPlayerHealthEx"
C:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(191) : error 010: invalid function or declaration
C:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(218) : warning 209: function "cmd_engine" should return a value
C:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(220) : error 003: declaration of a local variable must appear in a compound block
C:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(243) : warning 209: function "cmd_music" should return a value
C:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(268) : warning 209: function "cmd_vlights" should return a value
C:\Users\logan_000\Desktop\Samp server\gamemodes\lramos15.pwn(519) : warning 203: symbol is never used: "gTeam"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
SetPlayerHealth(playerid, 100);
return 1;
}
new Float:x, Float:y, Float:z;
}
}
CMD:enter(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1929.3467,-1776.0195,13.5469))
{
SetPlayerPos(playerid,-30.946699,-89.609596,1003.549988);//Idlegas entrance
SetPlayerInterior(playerid, 18);
}
return 1;
}
CMD:exit(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, -30.9595,-91.7379,1003.5469)) SetPlayerPos(playerid,1929.3467,-1776.0195,13.5469);//Idlegas Exit
return 1;
}
CMD:music(playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "You are not in a vehicle!!");
ShowPlayerDialog(playerid, 4576, DIALOG_STYLE_LIST, "Music","Pulse FM Pure Dance\n Hip Hop", "Select", "Cancel");
return 1;
}
CMD:v(playerid, params[])
{
if(!strcmp(params, "lights", true))
{
new vehicleid = GetPlayerVehicleID(playerid);//Gets the vehicle Id of the player
new engine, lights, alarm, doors, bonnet, boot, objective;//these are the defines of the thing used in the command.
if(IsPlayerInAnyVehicle(playerid))//This will check that if a player is in the vehicle or not.
{
if(GetPlayerVehicleSeat(playerid) == 0) //Now this will check that if a player is on the driving seat or not.
{
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);//will check that what is the state of the lights.
if(lights == 1)//will check that if the lights are on or not.
{
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);//this will check that what is the state of the lights.That is is on or off.We can use it for multiple things like doors,alarms etc.But In this case I am using this for the lights only.
SetVehicleParamsEx(vehicleid,engine,false,alarm,doors,bonnet,boot,objective);//when we change the engine and replace it with false,this will turn the vehicle engine off.Same if we make if true,this will make the engine on.
GameTextForPlayer(playerid,"The vehicle lights have been turned off.",2000,6);//for a text to appar on the screen for only 2 seconds.
}
else
{
SetVehicleParamsEx(vehicleid,engine,true,alarm,doors,bonnet,boot,objective);//if vehicle engine is false it will change it to true.
GameTextForPlayer(playerid,"The vehicle lights have turned on!",2000,6);//for a text to appar on the screen for only 2 seconds.
}
}
else SendClientMessage(playerid,-1,"Error: You are not at the driving seat!");//this is an error message,that if a player is not on the driving seat,this error message would appear.
}
else SendClientMessage(playerid,-1,"Error: You are not in a vehicle!");//this is the error message,that if a player is not in the car,the error message would apper.
}
return 1;
}
CMD:frontfall(playerid, params[])
{
ApplyAnimation(playerid, "PED", "KO_shot_front",4.1,0,1,1,1,1);
return 1;
}
CMD:stopanim(playerid, params[])
{
ClearAnimations(playerid);
return 1;
}
CMD:heal(playerid,params[])
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "This command can only be used by an admin!!");
SetPlayerHealth(playerid, 100);
return 1;
}
CMD:camera(playerid,params[])
new Float:x, Float:y, Float:z;
GetPlayerCameraPos(playerid, x, y, z);
printf("You are looking at at %f,%f,%f.", x, y, z);
}
CMD:heal(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "This command can only be used by an admin!!");
SetPlayerHealth(playerid, 100);
return 1;
}
CMD:camera(playerid,params[])
{
new Float:x, Float:y, Float:z;
GetPlayerCameraPos(playerid, x, y, z);
printf("You are looking at at %f,%f,%f.", x, y, z);
}