CMD:vehicle(playerid, params[])
{
if(pInfo[playerid][pLevel] >= 1)
{
new veh[30],vehid;
if(sscanf(params, "s[30]", veh)) return SendClientMessage(playerid, yellow, "Usage: /vehicle <Model ID/Vehicle Name>");
if (IsPlayerInAnyVehicle(playerid)) return ShowMessage(playerid, red, 7);
if(IsNumeric(veh)) vehid = strval(veh);
else vehid = ReturnVehicleModelID(veh);
if(vehid < 400 || vehid > 611) return SendClientMessage(playerid, red, "Invalid vehicle model!");
GiveVehicle(playerid,vehid);
CommandToAdmins(playerid,"vehicle");
return 1;
}
else return ShowMessage(playerid, red, 1);
}
CMD:spawncar(playerid, params[])
{
if(pInfo[playerid][pLevel] >= 2)
{
new veh[30],vehid;
if(sscanf(params, "s[30]", veh)) return SendClientMessage(playerid, yellow, "Usage: /spawncar <Model ID/Vehicle Name>");
if(IsNumeric(veh)) vehid = strval(veh);
else vehid = ReturnVehicleModelID(veh);
if(vehid < 400 || vehid > 611) return SendClientMessage(playerid, red, "Invalid vehicle model!");
SpawnVehicle(playerid,vehid);
CommandToAdmins(playerid,"spawncar");
return 1;
}
else return ShowMessage(playerid, red, 1);
}
CMD:givecar(playerid,params[])
{
if(pInfo[playerid][pLevel] >= 2)
{
new id;
if(sscanf(params, "u", id)) return SendClientMessage(playerid, yellow, "Usage: /givecar <Player ID>");
if(!IsPlayerConnected(id)) return ShowMessage(playerid, red, 2);
if (IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid,red,"Error: player is inside a vehicle!");
GiveVehicle(id,560);
CommandToAdmins(playerid,"givecar");
format(Jstring,sizeof(Jstring),"Admin '%s' has given you a Car!",GetName(playerid));
SendClientMessage(id,lighterblue,Jstring);
format(Jstring,sizeof(Jstring),"You have given '%s' a Car!", GetName(id));
return SendClientMessage(playerid, yellow,Jstring);
}
else return ShowMessage(playerid, red, 1);
}
CMD:giveveh(playerid,params[])
{
if(pInfo[playerid][pLevel] >= 3)
{
new id,veh[30],vehid;
if(sscanf(params, "us[30]", id ,veh)) return SendClientMessage(playerid, yellow, "Usage: /giveveh <Player ID> <VehicleID/Name>");
if(!IsPlayerConnected(id)) return ShowMessage(playerid, red, 2);
if (IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid,red,"Error: player is inside a vehicle!");
if(IsNumeric(veh)) vehid = strval(veh);
else vehid = ReturnVehicleModelID(veh);
if(vehid < 400 || vehid > 611) return SendClientMessage(playerid, red, "Invalid vehicle model!");
GiveVehicle(id,vehid);
CommandToAdmins(playerid,"giveveh");
format(Jstring,sizeof(Jstring),"Admin '%s' has given you a vehicle!",GetName(playerid));
SendClientMessage(id,lighterblue,Jstring);
format(Jstring,sizeof(Jstring),"You have given '%s' a vehicle!", GetName(id));
return SendClientMessage(playerid, yellow,Jstring);
}
else return ShowMessage(playerid, red, 1);
}
Is it cool ? I'm enjoying the scripts rhythem eh
It should be that :]
I've been scripting for a server of SAMP.
heres just A LITTLE of my example scripts:
Is it cool ? I'm enjoying the scripts rhythem ehCMD:vehicle(playerid, params[]) { if(pInfo[playerid][pLevel] >= 1) { new veh[30],vehid; if(sscanf(params, "s[30]", veh)) return SendClientMessage(playerid, yellow, "Usage: /vehicle <Model ID/Vehicle Name>"); if (IsPlayerInAnyVehicle(playerid)) return ShowMessage(playerid, red, 7); if(IsNumeric(veh)) vehid = strval(veh); else vehid = ReturnVehicleModelID(veh); if(vehid < 400 || vehid > 611) return SendClientMessage(playerid, red, "Invalid vehicle model!"); GiveVehicle(playerid,vehid); CommandToAdmins(playerid,"vehicle"); return 1; } else return ShowMessage(playerid, red, 1); } CMD:spawncar(playerid, params[]) { if(pInfo[playerid][pLevel] >= 2) { new veh[30],vehid; if(sscanf(params, "s[30]", veh)) return SendClientMessage(playerid, yellow, "Usage: /spawncar <Model ID/Vehicle Name>"); if(IsNumeric(veh)) vehid = strval(veh); else vehid = ReturnVehicleModelID(veh); if(vehid < 400 || vehid > 611) return SendClientMessage(playerid, red, "Invalid vehicle model!"); SpawnVehicle(playerid,vehid); CommandToAdmins(playerid,"spawncar"); return 1; } else return ShowMessage(playerid, red, 1); } CMD:givecar(playerid,params[]) { if(pInfo[playerid][pLevel] >= 2) { new id; if(sscanf(params, "u", id)) return SendClientMessage(playerid, yellow, "Usage: /givecar <Player ID>"); if(!IsPlayerConnected(id)) return ShowMessage(playerid, red, 2); if (IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid,red,"Error: player is inside a vehicle!"); GiveVehicle(id,560); CommandToAdmins(playerid,"givecar"); format(Jstring,sizeof(Jstring),"Admin '%s' has given you a Car!",GetName(playerid)); SendClientMessage(id,lighterblue,Jstring); format(Jstring,sizeof(Jstring),"You have given '%s' a Car!", GetName(id)); return SendClientMessage(playerid, yellow,Jstring); } else return ShowMessage(playerid, red, 1); } CMD:giveveh(playerid,params[]) { if(pInfo[playerid][pLevel] >= 3) { new id,veh[30],vehid; if(sscanf(params, "us[30]", id ,veh)) return SendClientMessage(playerid, yellow, "Usage: /giveveh <Player ID> <VehicleID/Name>"); if(!IsPlayerConnected(id)) return ShowMessage(playerid, red, 2); if (IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid,red,"Error: player is inside a vehicle!"); if(IsNumeric(veh)) vehid = strval(veh); else vehid = ReturnVehicleModelID(veh); if(vehid < 400 || vehid > 611) return SendClientMessage(playerid, red, "Invalid vehicle model!"); GiveVehicle(id,vehid); CommandToAdmins(playerid,"giveveh"); format(Jstring,sizeof(Jstring),"Admin '%s' has given you a vehicle!",GetName(playerid)); SendClientMessage(id,lighterblue,Jstring); format(Jstring,sizeof(Jstring),"You have given '%s' a vehicle!", GetName(id)); return SendClientMessage(playerid, yellow,Jstring); } else return ShowMessage(playerid, red, 1); }