Question about string
#1

The command is for helper's to set people to the PD in LS .. but i dont know how you get "Helper "Name" has tped to you the police department?"


Quote:

command(pdhim, playerid, params[]) {
new string[128], playerid, pname[24];
format(string, sizeof(string), "HELPER %s teleported you to the police department LS", GetName(GetPlayerID(inputtext)));
SendClientMessage(playerid, RED, string);
if(Player[playerid][Tester] >= 1)
SetPlayerPos(playerid, 1551.8000488281, 1670.4000244141, );
SetPlayerInterior(playerid, SpawnInt);
SetPlayerVirtualWorld(playerid, 0);
}

and here is another one i don't get with string ! :


Quote:

CMD:fixvw(playerid, params[])
{
new string[128], playerid, pname[24];

GetPlayerName(playerid, pname, sizeof(pname));

if(Player[playerid][Tester] >= 1)
{
SetPlayerVirtualWorld(playerid, 0);
format(string, sizeof(string), "HELPER %s has fixed your virtual world", pname);
SendClientMessage(playerid, RED, string);
}
return 1;
}

This upper this one doen'st work and the string goed to the one who typed the command .. and the comamnd doesn't work anymore after i did that string !
Reply
#2

pawn Code:
CMD:pdhim(playerid, params[])
{
    new string[128], target, aName[24];
    if(Player[playerid][Tester] < 1) return 0;
    if(sscanf(params,"d",target)) return SendClientMessage(playerid,-1,"SYNTAX: /pdhim [ID]");
    if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"Invalid Player ID!");
    GetPlayerName(playerid,aName,24);
    format(string, sizeof(string), "HELPER %s teleported you to the police department LS", aName);
    SendClientMessage(target, RED, string);
    SetPlayerPos(target, 1551.8000488281, 1670.4000244141,0.0);//add here Z co-ordinate
    SetPlayerInterior(target, SpawnInt);
    SetPlayerVirtualWorld(target, 0);
    return 1;
}

CMD:fixvw(playerid, params[])
{
    new string[128], target, pname[24];
    if(Player[playerid][Tester] < 1) return 0;
    if(sscanf(params,"d",target)) return SendClientMessage(playerid,-1,"SYNTAX: /fixvw [ID]");
    if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"Invalid Player ID!");
    GetPlayerName(playerid, pname, sizeof(pname));
    SetPlayerVirtualWorld(target, 0);
    format(string, sizeof(string), "HELPER %s has fixed your virtual world", pname);
    SendClientMessage(playerid, RED, string);
    return 1;
}
Here.

NOTE: UNTESTED!
Reply
#3

Quote:

C:\Users\Eigenaar\Desktop\SAMP\gamemodes\VortexRol eplay.pwn(12750) : error 029: invalid expression, assumed zero
C:\Users\Eigenaar\Desktop\SAMP\gamemodes\VortexRol eplay.pwn(12750) : error 029: invalid expression, assumed zero

By this lane SetPlayerPos([playerid, 1551.8000488281, 1670.4000244141, );
Reply
#4

It's
pawn Code:
SetPlayerPos(playerid, 1551.8000488281, 1670.4000244141, Float:Z);
Reply
#5

Check you another topic. I really don't know why you made two topics
Reply
#6

I get tped to LV Airport by using /pdhim
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)